package end.ser.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import end.bean.shiro.Resource;
import end.dao.ResourceDAO;
import end.ser.ResourceSER;

/**
 * 
 * ResourceSERImp.java 2016-7-14
 * 
 * Copyright zhaocj Inc. All rights reserved. Love Me Like Love Justin Bieber
 */
@Service("resourceSER")
public class ResourceSERImp<T> extends BaseSERImp<T> implements ResourceSER<T> {
	@Autowired
	private ResourceDAO<T> mapperDAO;

	public ResourceDAO<T> getMapperDAO() {
		return mapperDAO;
	}

	public void setMapperDAO(ResourceDAO<T> mapperDAO) {
		this.mapperDAO = mapperDAO;
	}

	@Override
	public List<Resource> queryMenuResources() {
		return getMapperDAO().queryMenuResources();
	}

	@Override
	public Integer[] queryMenuRightsByManager(Object key) {
		return getMapperDAO().queryMenuRightsByManager(key);
	}

	@Override
	public List<Resource> queryFunctionByRoleId(Integer id) {
		return getMapperDAO().queryFunctionByRoleId(id);
	}

	@Override
	public List<Resource> queryFuncResourcesTree() {
		return getMapperDAO().queryFuncResourcesTree();
	}

	@Override
	public List<Resource> queryMenuResourcesTree() {
		return getMapperDAO().queryMenuResourcesTree();
	}

	@Override
	public Integer[] queryResourceRightsByRoleID(Object key) {
		return getMapperDAO().queryResourceRightsByRoleID(key);
	}

	@Override
	public boolean updateRightsResourceByRole(Integer[] rights, Integer roleID) {
		return getMapperDAO().updateRightsResourceByRole(rights, roleID);
	}

}
